﻿@model LAPI.Data.Model.Usuario

<div class="row">
    <h2>Bienvenido de nuevo a LAPI</h2>
    <h3>Teclea tu usuario y contraseña para entrar</h3>
</div>
<hr />

<div class="marketing">
    <div class="row">
            @using (Ajax.BeginForm(
            actionName: "Login",
            controllerName: "Usuario",
            routeValues: null,
            ajaxOptions: new AjaxOptions { HttpMethod = "Post"  /*, InsertionMode = System.Web.Mvc.Ajax.InsertionMode.InsertBefore, UpdateTargetId = "alerts"*/, OnFailure = "PostFailure", OnSuccess = "PostSuccess", OnComplete = "PostOnComplete" },
            htmlAttributes: new Dictionary<string, object> { { "class", "form-horizontal" } }
        ))
            { 

                <div class="control-group">
                    <!-- @LAPI.Web.Helpers.LabelExtensions.LabelFor(this.Html, m => m.User, new Dictionary<string, object> { { "class", "control-label" } })-->
                    <div class="controls">
                        @LAPI.Web.Helpers.TextBoxExtension.TextBoxFor(this.Html, m => m.User, new Dictionary<string, object> { { "class", "span3" }, { "placeholder", "introduzca su nombre de usuario..." } })
                    </div>
                </div>
                
                <div class="control-group">
                    <!-- @LAPI.Web.Helpers.LabelExtensions.LabelFor(this.Html, m => m.Password, new Dictionary<string, object> { { "class", "control-label" } })-->
                    <div class="controls">
                        @LAPI.Web.Helpers.TextBoxExtension.TextBoxFor(this.Html, m => m.Password, new Dictionary<string, object> { { "class", "span3" }, { "placeholder", "introduzca su contraseña..." } })
                    </div>
                </div>

                <div class="control-group">
                    <div class="controls">
                        <div class="row-fluid">
                            <div class="span2">
                                <button type="submit" class="btn-large btn-primary">Entrar</button>
                            </div>
                            <div class="span3">
                                <p>
                                    @Html.ActionLink(
                                        linkText: "Aún no soy miembro",
                                        actionName: "Registro",
                                        controllerName: "Usuario",
                                        routeValues: new { },
                                        htmlAttributes: null
                                    )
                                <br />
                                    @Html.ActionLink(
                                        linkText: "No recuerdo mi contraseña",
                                        actionName: "RecordarPassword",
                                        controllerName: "Usuario",
                                        routeValues: new { },
                                        htmlAttributes: null
                                    )
                                </p>
                            </div>
                        </div>
                    </div>
                </div>               
            }
    </div>
    <div class="row">
        <div id="msg" class="span5"></div> 
    </div>
</div>

@section Script {   
<script type="text/javascript">
    document.forms[0].User.focus();
</script>
}
